﻿using System.Collections;
using System.Collections.Generic;
using TMPro;
using UnityEngine;

namespace Shows_3D
{
    public class Measure : MonoBehaviour
    {
        [SerializeField]
        public Point[] points;
        [SerializeField]
        public TextMeshProUGUI[] texts; 

        private string distance;
        private void Update()
        {
            distance = Vector3.Distance(points[0].transform.position,points[1].transform.position).ToString("F2");
            foreach(TextMeshProUGUI text in texts)
            {
                text.text = distance + "(M)";
            }
        }
    }
}
